package com.pacai.overload;

public class OverLoad01 {
    public static void main(String[] args) {
        System.out.println("hello");
        System.out.println(111);
        System.out.println(1.12);
        System.out.println(true);
        System.out.println('c');

        MyCalculator myCalculator = new MyCalculator();
        myCalculator.calculate(1,2);
        myCalculator.calculate(1,1.2);
        myCalculator.calculate(1.2,1);
        myCalculator.calculate(1,1,2);

    }
}

class MyCalculator {
    public int calculate(int a, int b) {
        return a + b;
    }

//    public int calculate(int b, int a) {
//        return a + b;
//    } error

    public int calculate(int a, int b, int c) {
        return a + b + c;
    }

    public double calculate(int a,double b){
        return a + b;
    }

    public double calculate(double b,int a){
        return a + b;
    }
}
